package io.github.biezhi.elves;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import io.github.biezhi.elves.main.ShareholderMain;

/**
 * 服务应用Application入口类
 */
@SpringBootApplication
@MapperScan(basePackages = "io.github.biezhi.elves.mapper")
public class Application {
	public static void main(String[] args) throws Exception {
//		SpringApplication.run(Application.class, args);
		
		ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
		//爬虫数据(1:爬取企查查数据；2:爬取百度拾取坐标系统爬虫酒店/会所数据)
		ShareholderMain shareholderMain = context.getBean(ShareholderMain.class);
		shareholderMain.startShareholder(34);
		synchronized (Application.class) {
			while (true) {
				try {
					Application.class.wait();
				} catch (Exception e) {
					e.printStackTrace();
					break;
				}
			}
		}
	}
}